import type { RouteRecordRaw } from 'vue-router';

// 定义路由类型
const routes: Array<RouteRecordRaw> = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/Login/index.vue'),
  },
  // 其他路由
  {
    path: '/',
    name: 'Home',
    redirect: '/welcome',
    component: () => import('@/views/Home/index.vue'),
    children: [
      {
        path: '/welcome',
        name: 'welcome',
        meta: { title: '欢迎', icon: 'HomeOutlined' },
        component: () => import('@/views/Welcome/index.vue'),
      },
      {
        path: '/passenger',
        name: 'Passenger',
        meta: { title: '乘车人管理' },
        component: () => import('@/views/Passenger/index.vue'),
      },
      {
        path: '/ticket',
        name: 'Ticket',
        meta: { title: '余票查询' },
        component: () => import('@/views/Ticket/index.vue'),
      },
      {
        path: '/myTicket',
        name: 'MyTicket',
        meta: { title: '我的车票' },
        component: () => import('@/views/MyTicket/index.vue'),
      },
      {
        path: '/order',
        name: 'Order',
        meta: { title: '订单详情', hide: true },
        component: () => import('@/views/Order/index.vue'),
      },
      {
        path: '/seat',
        name: 'Seat',
        meta: { title: '座位销售图' },
        component: () => import('@/views/Seat/index.vue'),
      },
    ],
  },
];

export default routes;
